package com.yuxi.model;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * Created by yuxi on 16/10/24.
 */
@Component
@ConfigurationProperties(prefix = "user")
public class User implements Serializable {

    //    @Value("${id}")
    private int id;
    //    @Value("${name}")
    private String username;
    //    @Value("${age}")
    private int age;

    private String password;

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public User(String name, String password) {
        this.username = name;
        this.password = password;
    }

    public User() {
    }

    public User(int id, String name, int age, String password) {
        this.id = id;
        this.username = name;
        this.age = age;
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + username + '\'' +
                ", age=" + age +
                '}';
    }
}
